package com.codenum.codegenerator;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
* the Qkgdgehu type
*/
@SuppressWarnings("ALL")
public class Qkgdgehu {


        private static volatile Qkgdgehu instance;

        /**
        * 方法MethodMap
        */
        private Map<String, Method> methodMap = new HashMap<>(32);

        private Map<String, Object> saleTypeMap = new HashMap<>(64);

        public static Qkgdgehu getInstance() {
            if (instance == null) {
                synchronized (Qkgdgehu.class) {
                    if (instance == null) {
                        instance = new Qkgdgehu();
                    }
                }
            }
            return instance;
        }


        private Qkgdgehu() {

        }



    public  Boolean judgeTqwlbslnpr(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeMrvmoesbst(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeJrclloxzhk(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeQssqvtcmzj(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeIwjwhdjirs(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeUaqjyvdumr(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeZbhwhghukv(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeMtuxejeotk(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgePpppvedrpl(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeIrxocpmmfc(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeVlvyddmbuo(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }

    private String  tqwlbslnpr;
    private String  mrvmoesbst;
    private String  jrclloxzhk;
    private String  qssqvtcmzj;
    private String  iwjwhdjirs;
    private String  uaqjyvdumr;
    private String  zbhwhghukv;
    private String  mtuxejeotk;
    private String  ppppvedrpl;
    private String  irxocpmmfc;
    private String  vlvyddmbuo;


    public void setTqwlbslnpr(String tqwlbslnpr){
    this.tqwlbslnpr = tqwlbslnpr;
    }

    public String getTqwlbslnpr(){
    return this.tqwlbslnpr;
    }
    public void setMrvmoesbst(String mrvmoesbst){
    this.mrvmoesbst = mrvmoesbst;
    }

    public String getMrvmoesbst(){
    return this.mrvmoesbst;
    }
    public void setJrclloxzhk(String jrclloxzhk){
    this.jrclloxzhk = jrclloxzhk;
    }

    public String getJrclloxzhk(){
    return this.jrclloxzhk;
    }
    public void setQssqvtcmzj(String qssqvtcmzj){
    this.qssqvtcmzj = qssqvtcmzj;
    }

    public String getQssqvtcmzj(){
    return this.qssqvtcmzj;
    }
    public void setIwjwhdjirs(String iwjwhdjirs){
    this.iwjwhdjirs = iwjwhdjirs;
    }

    public String getIwjwhdjirs(){
    return this.iwjwhdjirs;
    }
    public void setUaqjyvdumr(String uaqjyvdumr){
    this.uaqjyvdumr = uaqjyvdumr;
    }

    public String getUaqjyvdumr(){
    return this.uaqjyvdumr;
    }
    public void setZbhwhghukv(String zbhwhghukv){
    this.zbhwhghukv = zbhwhghukv;
    }

    public String getZbhwhghukv(){
    return this.zbhwhghukv;
    }
    public void setMtuxejeotk(String mtuxejeotk){
    this.mtuxejeotk = mtuxejeotk;
    }

    public String getMtuxejeotk(){
    return this.mtuxejeotk;
    }
    public void setPpppvedrpl(String ppppvedrpl){
    this.ppppvedrpl = ppppvedrpl;
    }

    public String getPpppvedrpl(){
    return this.ppppvedrpl;
    }
    public void setIrxocpmmfc(String irxocpmmfc){
    this.irxocpmmfc = irxocpmmfc;
    }

    public String getIrxocpmmfc(){
    return this.irxocpmmfc;
    }
    public void setVlvyddmbuo(String vlvyddmbuo){
    this.vlvyddmbuo = vlvyddmbuo;
    }

    public String getVlvyddmbuo(){
    return this.vlvyddmbuo;
    }

    void setMethodMap(Map<String, Method> methodMap) {
        this.methodMap = methodMap;
    }

   void setSaleTypeMap(Map<String, Object> saleTypeMap) {
        this.saleTypeMap = saleTypeMap;
    }

    public Boolean judgeAttributeValue(String saleType, String methodName) {
        try {
            Object saleTypeObject = saleTypeMap.get(saleType);
            String targetMethod = methodName.replace("judge", "get");
            String attr = methodName.replace("judge", "");
            Method method = methodMap.get(targetMethod);
            Object invoke = method.invoke(saleTypeObject);
            return Objects.isNull(invoke) ? Boolean.FALSE : Objects.equals(invoke.toString().toLowerCase(), attr.toLowerCase());
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e.getMessage());
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e.getMessage());
        }
    }

}